from random import choice

from clubs import CLUBS
from match.match import Match
from domain.standings import Standings
from domain.calendar import Calendar


class Simulation(object):

    def __init__(self, player_team_name):
        self.calendar = Calendar(1, 2010)
        self.player_team_name = player_team_name
        self.player_team = CLUBS[player_team_name]
        self.challenger = choice(CLUBS.values())
        self.standings = Standings(CLUBS)
    
    def advance(self):
        self.last_match = Match(self.player_team, self.challenger)
        self.last_match.play()
        self.standings.update_with_match(self.last_match)
        
        self.calendar.advance_week()
        self.challenger = choice(CLUBS.values())
        print 'Advance to %s' % (self.calendar)
        print 'Next game against %s' % (self.challenger.name)
        